﻿function PersonController($scope, $http) {
    var url = "/Ajax/GetJsonResult";
    var postData = [{ "Name": "Kelvin", "Age": "35" }, { "Name": "Hdy", "Age": "25" }, { "Name": "Cxm", "Age": "24" }];

    // The next line gets appended to the URL as params
    // so it would become a post request to /api/user?id=5
    //var config = { params: { id: '5' } };
    $('#btnSubmit').click(function () {
        $http.post(url, postData)
            .success(function (data, status, headers, config) {
                // Do something successful
                ZEUS.DEBUG.log("Request Data: ");
                ZEUS.DEBUG.log(JSON.stringify(postData));
                $('#label1').html('Result Below:');
                $scope.persons = data;
            }).error(function (data, status, headers, config) {
                // Handle the error
            });
    });
}